package com.faryangsh.bean.one;


import lombok.extern.slf4j.Slf4j;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author 杨志远[of2551]
 *         company qianmi.com
 *         Date    2017-07-11
 */
@javax.persistence.Entity
@Slf4j
//@NamedQuery(name = "User.findByName", query = "select name,address from User u where u.name=?1")
public class UserOne implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    long id;
    @Column(name = "name")
    String name;
    @Column(name = "address")
    String address;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @PostUpdate
    void postupdate() {
        System.out.println("postUpdate");
    }

    @PreUpdate
    void PreUpdate() {
        System.out.println("PreUpdate");
    }

    @PrePersist
    void PrePersist() {
        System.out.println("PreUpdate");

    }
    @PostPersist
    void PostPersist(){
        System.out.println("@PostPersist");
    }

    @PostLoad
    void PostLoad(){
        System.out.println("@PostLoad");
    }

    @PreRemove
    void PreRemove(){
        System.out.println("@PreRemove");
    }

}
